package com.swanclouds.redfish.systems.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.common.redfish.Status;
import com.swanclouds.model.systems.Volume;

/**
 * 逻辑卷信息
 *
 * @author 张立强
 */
public class VolumeModel implements Volume {

    @JsonProperty("CapacityBytes")
    private Long capacityBytes;
    /**
     * 逻辑盘的容量
     *
     * @return capacityBytes
     */
    @Override
    public Long getCapacityBytes() {
        return this.capacityBytes;
    }

    @JsonProperty("RaidControllerID")
    private Integer raidControllerID;
    /**
     * 逻辑盘所属控制器ID
     *
     * @return raidControllerID
     */
    @Override
    public Integer getRaidControllerID() {
        return this.raidControllerID;
    }

    @JsonProperty("VolumeRaidLevel")
    private String volumeRaidLevel;
    /**
     * 逻辑盘 Raid 级别
     *
     * @return volumeRaidLevel
     */
    @Override
    public String getVolumeRaidLevel() {
        return this.volumeRaidLevel;
    }

    @JsonProperty("CurrentReadPolicy")
    private String currentReadPolicy;
    /**
     * 逻辑盘当前读策略
     *
     * @return currentReadPolicy
     */
    @Override
    public String getCurrentReadPolicy() {
        return this.currentReadPolicy;
    }

    @JsonProperty("CurrentWritePolicy")
    private String currentWritePolicy;
    /**
     * 逻辑盘当前写策略
     *
     * @return currentWritePolicy
     */
    @Override
    public String getCurrentWritePolicy() {
        return this.currentWritePolicy;
    }

    @JsonProperty("CurrentCachePolicy")
    private String currentCachePolicy;
    /**
     * 逻辑盘当前cache 策略
     *
     * @return currentCachePolicy
     */
    @Override
    public String getCurrentCachePolicy() {
        return this.currentCachePolicy;
    }

    @JsonProperty("AccessPolicy")
    private String accessPolicy;
    /**
     * 逻辑盘访问策略
     *
     * @return accessPolicy
     */
    @Override
    public String getAccessPolicy() {
        return this.accessPolicy;
    }

    @JsonProperty("Status")
    private com.swanclouds.redfish.common.redfish.Status status;
    /**
     * 逻辑盘的状态
     * @see com.swanclouds.redfish.common.redfish.Status
     * @return status
     */
    @Override
    public Status getStatus() {
        return this.status;
    }

    @JsonProperty("@odata.id")
    private String dataId;
    /**
     * 系统资源的访问路径 @odata.id
     *
     * @return dataId
     */
    @Override
    public String getDataId() {
        return this.dataId;
    }

    @JsonProperty("@odata.context")
    private String context;
    /**
     * 系统资源模型的OData描述信息 @odata.context
     *
     * @return context
     */
    @Override
    public String getContext() {
        return this.context;
    }

    @JsonProperty("@odata.type")
    private String type;
    /**
     * 系统资源的类型 @odata.type
     *
     * @return type
     */
    @Override
    public String getType() {
        return this.type;
    }

    @JsonProperty("Id")
    private String id;
    /**
     * 系统资源的ID
     *
     * @return id
     */
    @Override
    public String getId() {
        return this.id;
    }

    @JsonProperty("Name")
    private String name;
    /**
     * 系统资源的名称 Name
     *
     * @return name
     */
    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "VolumeModel {" +
                "capacityBytes=" + capacityBytes +
                ", raidControllerID=" + raidControllerID +
                ", volumeRaidLevel='" + volumeRaidLevel + '\'' +
                ", currentReadPolicy='" + currentReadPolicy + '\'' +
                ", currentWritePolicy='" + currentWritePolicy + '\'' +
                ", currentCachePolicy='" + currentCachePolicy + '\'' +
                ", accessPolicy='" + accessPolicy + '\'' +
                ", status=" + status +
                ", dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
